package org.bootlimn.common;

/**
 * @author satsiv
 * This class defines the structure of a stats element as outputted by statsinfo 
 * and functions to access the individual attributes
 */
public class Stats {
	private int time;				// timestamp
	private int CPUutil;			// CPU utilization
	private int CPUtput;			// CPU throughput
	private int diskutil;			// Disk utilization
    private int disktput;			// Disk throughput
       

	//constructor	
	
	public Stats(int time, int CPUutil, int CPUtput, int diskutil, int disktput) {
		this.time = time;
		this.CPUutil = CPUutil;
		this.CPUtput  = CPUtput;
		this.diskutil = diskutil;
                this.disktput = disktput;	
	}

	//functions to access individual attributes

	public int getTime() {
		return time;
	}

	public void setTime(int time) {
		this.time = time;
	}

	public int getCPUutil() {
		return CPUutil;
	}
       
        public void seCPUutil(int CPUutil) {
		this.CPUutil = CPUutil;
	}

        public int getCPUtput() {
		return CPUtput;
	}

	public void setCPUtput(int CPUtput) {
		this.CPUtput = CPUtput;
	}

	public int getDiskutil() {
		return diskutil;
	}

	public void setDiskutil(int diskutil) {
		this.diskutil = diskutil;
	}

        public int getDisktput() {
		return disktput;
	}

	public void setDisktput(int disktput) {
		this.disktput = disktput;
	}
		
	
	// To print it all out (temporary for text output purpose)
	
	public String toString() {
		StringBuffer sb = new StringBuffer();
		sb.append("Stat	 Details - ");
		sb.append("Time:" + getTime());
		sb.append(", ");
		sb.append("CPUutil:" + getCPUutil());
		sb.append(", ");
		sb.append("CPUtput:" + getCPUtput());
		sb.append(", ");
		sb.append("Ciskutil:" + getDiskutil());
		sb.append(",");
		sb.append("DiskTput:" + getDisktput());
		sb.append(".\n");
		
		return sb.toString();
	}
}
